import { Controller, Get, Param } from '@nestjs/common';
import { ApiTags, ApiOperation } from '@nestjs/swagger';
import { TemplateService } from './template.service';

@ApiTags('templates')
@Controller('templates')
export class TemplateController {
  constructor(private readonly templateService: TemplateService) {}

  @Get('categories')
  @ApiOperation({ summary: '获取所有模板类型' })
  getCategories() {
    return this.templateService.getCategories();
  }

  @Get('base/:category')
  @ApiOperation({ summary: '获取基础模板' })
  getBaseTemplate(@Param('category') category: string) {
    return this.templateService.getBaseTemplate(category);
  }

  @Get('schema/:category')
  @ApiOperation({ summary: '获取参数schema' })
  getParamSchema(@Param('category') category: string) {
    return this.templateService.getParamSchema(category);
  }
} 